﻿using Microsoft.Phone.Tasks;
using MijnMultiOSRSSApp.Common.Resources;
using MijnMultiOSRSSApp.Common.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace MijnMultiOSRSSApp.Common.Commands
{
    public class ShareCommand : ICommand
    {
        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
        public void RaiseCanExecuteChanged()
        {
            if (CanExecuteChanged != null)
                CanExecuteChanged(this, new EventArgs());
        }

        public void Execute(object parameter)
        {
            new ShareStatusTask
            {
                Status = string.Format(AppResources.ShareText,
                    ViewModelLocator.Main.SelectedItem.Title,
                    ViewModelLocator.Main.SelectedItem.Link)
            }.Show();
        }
    }
}
